SYSTEM	= x86-64_sles9.0_3.3
LIBFORMAT	= static_pic


DRIVER          = driver
EXE		= $(DRIVER)
OBJS		= $(DRIVER).o
SRC		= $(DRIVER).c
CONCERTDIR	= /usr/local/ibm/ilog/cplex/concert25
CPLEXDIR     	= /usr/local/ibm/ilog/cplex/cplex121
CPLEXINCDIR  	= $(CPLEXDIR)/include
CONCERTINCDIR	= $(CONCERTDIR)/include
CPLEXLIBDIR  	= $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
CONCERTLIBDIR	= $(CONCERTDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
CFLAGS  	= -Wall
INCFLAGS	= -m64 -c -O -fPIC -fexceptions -DNDEBUG -DIL_STD
LINFLAGS	= -m64 -O -fPIC -fexceptions -DNDEBUG -DIL_STD
CC 		= g++
CPLEXLNFLAGS	= $(CPLEXLIBDIR) -lilocplex -lcplex -lpthread
CONCERTLNFLAGS	= $(CONCERTLIBDIR) -lconcert -lm -lpthread


all : $(EXE) 

$(EXE): $(OBJS)
	$(CC) $(CFLAGS) $(LINFLAGS) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR) $(OBJS) -o $(EXE) -L$(CPLEXLNFLAGS) -L$(CONCERTLNFLAGS) -lRmath 

$(OBJS): $(SRC)
	$(CC) $(CFLAGS) $(INCFLAGS) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR) $(SRC) -o $(OBJS) 
